package com.ruige.account.controller;


import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class AccountWebController {

    @RequestMapping("/toChange")
    public String toChange() {
        return "change.html";
    }

    @RequestMapping("/toLog")
    public String toLog() {
        return "log.html";
    }

    @RequestMapping("/toIndex")
    public String toIndex() {
        return "index.html";
    }

    @RequestMapping("/toLogin")
    public String toLogin(@RequestParam(value = "FROM", required = false, defaultValue = "") String from, Model model) {
        model.addAttribute("from", from);
        return "login";
    }

    @RequestMapping("/toRegister")
    public String toRegister() {
        return "register";
    }

    @RequestMapping("/404")
    public String notFound() {
        return "404";
    }
}
